package com.learn.sb.webfluxdemo.init;


import com.learn.sb.webfluxdemo.eitity.User;
import com.learn.sb.webfluxdemo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

@Component
public class Init implements CommandLineRunner {

	@Autowired
	UserService userService;

	@Override
	public void run(String... strings) throws Exception {
		userService.setUser("1", new User("carlos", 18));
		userService.setUser("2", new User("lisa", 12));
		userService.setUser("3", new User("mike", 23));
		userService.setUser("4", new User("kaka", 10));
		userService.setUser("5", new User("amy", 28));
	}
}
